package com.example.rpcclientboottest.service;




import com.guguguweb.rpc.net.client.proxy.GuRpcClientProxy;
import com.guguguweb.rpc.test.interfaces.BootHelloService;
import com.guguguweb.rpc.test.interfaces.GuResultData;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TestServer implements InitializingBean {

    //获取客户端代理类工厂
    @Autowired
    GuRpcClientProxy guRpcClientProxy;

    private BootHelloService helloService;


    @Override
    public void afterPropertiesSet() throws Exception {
        helloService = guRpcClientProxy.getProxy(BootHelloService.class);
    }


    public GuResultData testRpc(){
        GuResultData data = helloService.getData("789212GUGUgu6666");
        return data;
    }


}
